package ooday05;

/**
 * 季节枚举
 */
public class EnumDemo {
    public static void main(String[] args) {
        Season s=Season.WINTER;
        switch (s){
            case SPRING:
                System.out.println(s.getSeasonName()+"很"+s.getSeasonDesc());
                break;
            case SUMMER:
                System.out.println(s.getSeasonName()+"很"+s.getSeasonDesc());
                break;
            case AUTUMN:
                System.out.println(s.getSeasonName()+"很"+s.getSeasonDesc());
                break;
            case WINTER:
                System.out.println(s.getSeasonName()+"很"+s.getSeasonDesc());
                break;
        }







        Season[] seasons=Season.values();//获取所以枚举的对象
        for(int i=0;i<seasons.length;i++){
            System.out.println(seasons[i]);//输出4个枚举对象(SPRING,SUMMER,AUTUMN,WINTER)
            System.out.println(seasons[i].getSeasonName());//输出名叫的名字属性
            System.out.println(seasons[i].getSeasonDesc());//输入枚举的描述属性
        }


        Season d = Season.WINTER;
        System.out.println(d.getSeasonDesc() + d.getSeasonName());

        Season c=Season.SPRING;
        System.out.println(c.getSeasonDesc()+c.getSeasonName());

        Season x=Season.SUMMER;
        System.out.println(x.getSeasonName()+x.getSeasonDesc());

        Season q=Season.AUTUMN;
        System.out.println(q.getSeasonName()+q.getSeasonDesc());
    }
}
